<h1>Отправка сообщения</h1>
{if (!$sended)}
<div class="form send-message-form blue">

    <div class="user-photo">
        <p class="to-user-label">Кому:</p>
        {assign var="toUser" value=$model->toUser0}
        <a href="/user/{$toUser->avatar_id}">
            {assign var="avatarSrc" value=UploadImageFacade::resolveImagePath($toUser->avatar_id, "84x123")}
            <img src="{$avatarSrc}" alt="" width="84" height="123" />
        </a>
        <p class="author"><a href="{$controller->getUserPageUrl($toUser->user_id)}">
            {UserFacade::getFullNameUser($toUser->user_id)}</a>
        </p>

    </div>

{WidgetActiveForm id="message-form" enableAjaxValidation=0 model=$model}	

	{afErrorSummary}

	<div class="row">
                {afLabelEx property='title'}                
                {afTextField property='title'}
                {afError property='title'}
	</div>

        <div class="row">
                {afLabelEx property='message'}
                {array assign="attr" rows=6 cols=50}
                {afTextArea property='message' attr=$attr}
                {afError property='message'}
	</div>                

        <div class="row buttons">
            {array assign="htmlOptions" class="popup-button submit"}
            {chtmlLink text="<span>Отправить</span>" url="#" htmlOptions=$htmlOptions}
	</div>

{/WidgetActiveForm}

</div><!-- form -->
{else}
    <p class="success">Ваше сообщение было отправлено.</p>
{/if}